<template>
  <div>
    <ClientOnly>
      <h1>Demo</h1>
      <p>Theme: {{ appConfig.title }}</p>
      <p>{{ data }}</p>
      <p>{{ status }}</p>
      <p>{{ error }}</p>
      <UButton @click="refresh()">
        重试
      </UButton>
      <div>
        <p>{{ session }}</p>
      </div>
    </ClientOnly>
  </div>
</template>

<script setup lang="ts">
const appConfig = useAppConfig()

const { data, status, error, refresh } = await useFetch('/api/todo/' + new Date().getTime(), {
  query: { param1: 'a', param2: 'value2' }
})

const { data: session } = await authClient.useSession(useFetch)

console.log(appConfig.title)
</script>
